/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package game.platformer;
import com.badlogic.gdx.physics.box2d.Body;
import game.platformer.interfaces.CharRepresentation;
import org.anddev.andengine.entity.sprite.Sprite;
/**
 *
 * @author cow
 */
public class Player extends CharRepresentation{
	private static Player pGuy = null;
	public static void initialize(Sprite s, Body b){
		pGuy = new Player(s, b);
	}
	public static Player getPlayer(){
		assert (pGuy != null);
		return pGuy;
	}
	private Player(Sprite spr, Body bdy){
		super(spr, bdy);
	}

	//overides---------------
	@Override
	public int hurt(int damage){
		setHealth(getHealth() - damage);
		if(getHealth() <= 0) platformer.getScreenManager().activateMainMenuScreen();
		return getHealth();
	}
	public void resetPlayer(){
		setHealth(4);
	}
}
